import { createElement, createTextNode, mount,patch } from './vdom';
const oldVnode = createElement('div', { id: 'container', key: 'container' },
    createElement('span', { class: 'title', style: { color: 'red' }, key: 'hello' }, createTextNode('hello')),
    createTextNode('world')
);
const app = document.querySelector('#app');
mount(app, oldVnode);
let differentType = document.querySelector('#differentType');
differentType.addEventListener('click', () => {
    const newVnode = createElement('p', { id: 'container', key: 'container' },
        createElement('span', { class: 'title', style: { color: 'red' }, key: 'hello' }, createTextNode('hello')),
        createTextNode('world')
    );
    patch(oldVnode,newVnode);
});